new Vue({
    el: "#app",
    data() {
        return {
            form: {
                page: 1,			//页数
                limit: 10,			//每页数据条数
                Warehouse_Name: "",
            },
            formData:{
                num:'',
                address:'',
            },
            dialogFormVisible:false,
            tableData: [{
                Warehouse_Inventory_SerialNumber: "",
                Warehouse_Name: "模拟仓库1",
                Article_Name: "模拟商品1",
                Inventory_Total_Quantity: "100",
                Remain_Quantity: "50",
                Out_Total_Quantity: "50",
                Enterprise_Name: "",
            }, {
                Warehouse_Inventory_SerialNumber: "",
                Warehouse_Name: "模拟仓库2",
                Article_Name: "模拟商品2",
                Inventory_Total_Quantity: "100",
                Remain_Quantity: "50",
                Out_Total_Quantity: "50",
                Enterprise_Name: "",
            }, {
                Warehouse_Inventory_SerialNumber: "",
                Warehouse_Name: "模拟仓库3",
                Article_Name: "模拟商品3",
                Inventory_Total_Quantity: "100",
                Remain_Quantity: "50",
                Out_Total_Quantity: "50",
                Enterprise_Name: "",
            }], //表格数据
            total: 1,
        };
    },
    mounted() {
        console.log(window.location.search.slice(24))
        this.getList(window.location.search.slice(24))
    },
    methods: {
        getList(data) {//查询所有的仓库数据
            let this_ = this
            // $.ajax({
            //   type: 'POST',
            //   url: DomainName + "/getInquiryAction?token="+$.cookie("token"),
            //   data,
            //   complete: function (XMLHttpRequest) {
            //     _this.loading = false
            //     if (XMLHttpRequest.getResponseHeader("REDIRECT") == "REDIRECT") {
            //       window.parent.document.location.href = "../../../" + XMLHttpRequest.getResponseHeader("CONTENTPATH");
            //     }
            //   },
            //   success: function (Result) {
            //     console.log(Result);
            //     _this.tableData = Result      //将获取的数据存到表格数据中
            //   },
            //   dataType: "json"
            // });
        },
        Submit(){
            let this_ = this
            // $.ajax({
            //   type: 'POST',
            //   url: DomainName + "/getAddAction?token="+$.cookie("token"),
            //   data,
            //   complete: function (XMLHttpRequest) {
            //     _this.loading = false
            //     if (XMLHttpRequest.getResponseHeader("REDIRECT") == "REDIRECT") {
            //       window.parent.document.location.href = "../../../" + XMLHttpRequest.getResponseHeader("CONTENTPATH");
            //     }
            //   },
            //   success: function (Result) {
            //     console.log(Result);
            //     _this.tableData = Result      //将获取的数据存到表格数据中
            this_.dialogFormVisible = false
            //   },
            //   dataType: "json"
            // });
        },
        Cancle(){
            this.dialogFormVisible = false
            this.formData.num = ''
            this.formData.address = ''
        },
        //号码改变查询
        handleSizeChange(val) {
            this.form.page = 1;
            this.form.limit = val;
            this.getList(this.form)
        },
        //号码按键查询
        handleCurrentChange(val) {
            this.form.page = val;
            this.getList(this.form)
        },
        addEnterprise() {//去增加仓库页
            window.location.href = './Add.html'
        },
        back(){//返回上一页
            window.history.go(-1)
        }
    },
});
